<?php 
/**
* @version		1.0  - 	Joomla 1.5.x
* @package	Component Administrator Com Products
* @copyright	Wampvn Group
* @license		GNU/GPL
* @website          http://wampvn.com
* @description    view product.
*/

defined( '_JEXEC' ) or die( 'Restricted access' ); 
		global $option;
		JToolBarHelper::title( JText::_('Sản phẩm'), 'generic.png');
		JToolBarHelper::save();
		JToolBarHelper::apply();
		JToolBarHelper::cancel('product');
		$editor =& JFactory::getEditor();
		JHTML::_('behavior.calendar');
		

?>
  <link href="<?php echo JURI::root();?>components/com_products/css/jquery-ui-1.8.1.custom.css" rel="stylesheet" type="text/css"/>
  <script src="<?php echo JURI::root();?>components/com_products/js/jquery.min.js"></script>
  <script src="<?php echo JURI::root();?>components/com_products/js/jquery-ui.min.js"></script>
  
  <script>
  jQuery.noConflict();  
  jQuery(document).ready(function() {
	  jQuery("#tabs").tabs();
  });

	function submitbutton(pressbutton) {
		var form = document.adminForm;
		if (pressbutton == 'product') {
			submitform( pressbutton );
			return;
		}

		if (pressbutton == 'delImg') {
			submitform( pressbutton );
			return;
		}

		if (pressbutton == 'save' || pressbutton == 'apply') {
			// do field validation
			if (form.name.value == ""){
				alert( "Vui lòng điền tên sản phẩm" );
			} else {
				submitform( pressbutton );
			}	
		}
	}
  </script>

	<form action="index.php" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
	<fieldset class="adminform">
	<legend>Add and Edit Product</legend>
	
	<div id="tabs">
	    <ul>
	        <li><a href="#tab-1"><span>General</span></a></li>
	        
	        <li><a href="#tab-3"><span>Picture</span></a></li>
	        <!--<li><a href="#tab-4"><span>Video</span></a></li>-->
	    </ul>
	    <div id="tab-1">
	<table class="admintable">
	<tr>
		<td width="100" align="right" class="key">
			Name:
		</td>
		<td>
			<input class="text_area" type="text" name="name" id="name" size="50" maxlength="250" value="<?php echo $this->product->name;?>" />
		</td>
	</tr>
	
	<tr >
		<td width="100" align="right" class="key">
			Category:
		</td>
		<td>
		<?php
			echo $this->lists['category'];
		?>
		</td>
	</tr>
	<!--
	<tr>
		<td width="100" align="right" class="key">
			Manufacturer:
		</td>
		<td>
		<?php
//			echo $this->lists['manufacturer'];
		?>
		</td>
	</tr>
	
	<tr>
		<td width="100" align="right" class="key">
			Giới thiệu:
		</td>
		<td>
                    <?php //echo $editor->display( 'shortdesc',  $this->product->shortdesc, '700', '250', '60', '20', array('pagebreak', 'readmore') ) ; ?>
		</td>
	</tr>
	-->
	<tr>
		<td width="100" align="right" class="key">
			Mô tả sản phẩm:
		</td>
		<td>
			<?php echo $editor->display( 'intro',  $this->product->intro, '700', '250', '60', '20', array('pagebreak', 'readmore') ) ; ?>
			
		</td>
	</tr>
	
		
	<tr>
		<td width="100" align="right" class="key">
			Published:
		</td>
		<td>
		<?php
			echo $this->lists['published'];
		?>
		</td>
	</tr>
	</table>
	    </div>
	    <!-- ket thuc tab 1 -->

	    <div id="tab-3">
	    	    <?php 
	    	    	echo $this->loadTemplate('picture');
	    	    ?>
	    </div>
	   
	</div>
	
	

	</fieldset>
		<input type="hidden" name="date" value="<?php echo $this->product->date; ?>" />
		<input type="hidden" name="id" value="<?php echo $this->product->id; ?>" />
		<input type="hidden" name="option" value="<?php echo $option;?>" />
		<input type="hidden" id="imgId" name="imgId" value="" />
		<input type="hidden" id="imgName" name="imgName" value="" />
		<input type="hidden" name="task" value="" />
	</form>